package cn.tellsea.mq.rabbitmq.listener;

import cn.tellsea.mq.rabbitmq.config.RabbitMqDelayConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 延迟队列
 *
 * @author Tellsea
 * @date 2023/9/6
 */
@Component
public class DelayTopicListener {

    @RabbitListener(queues = RabbitMqDelayConfig.DELAY_QUEUE)
    public void receiveMsg(Message message) {
        String msg = new String(message.getBody());
        System.out.println("接收延迟队列消息：" + msg);
    }
}
